cmake_minimum_required(VERSION 3.18)
project(Tomatoes_Detect LANGUAGES C CXX) 

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
SET(CMAKE_CXX_COMPILER /usr/bin/g++)
set(CMAKE_BUILD_TYPE debug)

#查找必要的依赖包
find_package(OpenCV 4 REQUIRED)
set(Open3D_ROOT /usr/local/bin/Open3D)
find_package(Open3D REQUIRED)
find_package(Threads)

set(InferenceEngine_DIR "/opt/intel/openvino_2021/inference_engine/share")
find_package(InferenceEngine)
set(ngraph_DIR "/opt/intel/openvino_2021/deployment_tools/ngraph")
set(ngraph_LIBRARIES "/opt/intel/openvino_2021/deployment_tools/ngraph/lib/libngraph.so")
set(ngraph_INCLUDE_DIRS "/opt/intel/openvino_2021/deployment_tools/ngraph/include")

# 指定生成目标
add_executable(main main.cpp)

add_subdirectory(Modules/CommandParser)
add_subdirectory(Modules/FrameProcessor)
add_subdirectory(Modules/Detector)
add_subdirectory(Modules/Strategy)
add_subdirectory(Modules/SerialPort)
add_subdirectory(Parameter)
add_subdirectory(RoboDecision)

target_link_libraries(main
        ${OpenCV_LIBS}
        ${InferenceEngine_LIBRARIES}
        ${ngraph_LIBRARIES}
        ${CMAKE_THREAD_LIBS_INIT}
        Open3D::Open3D
        -lpthread
)

# 添加链接库
target_link_libraries(main RoboDecision) 
